/*
 * https://en.wikipedia.org/wiki/Largest_known_prime_number
 *
 * The largest known prime number is 2^136,279,841 − 1, a number which has
 * 41,024,320 digits when written in base 10. It was found on October 12, 2024
 * on a cloud-based virtual machine volunteered by Luke Durant to the Great
 * Internet Mersenne Prime Search (GIMPS).
 *
 * Written by Copilot@Skype.
 */
#include <gmp.h>  // link with -lgmp
#include <stdio.h>

int main()
{
  // Redirect stdout to a file.
  freopen("2_to_136279841_minus_1.txt", "w", stdout);

  // Initialize the GMP integer.
  mpz_t result;
  mpz_init(result);

  // Compute 2^136279841 - 1.
  mpz_ui_pow_ui(result, 2, 136279841);
  mpz_sub_ui(result, result, 1);

  // Print the result.
  gmp_printf("%Zd\n", result);

  // Clear the GMP integer.
  mpz_clear(result);

  return 0;
}
